{% extends "base.html" %}

{% block content %}

<div class="container-fluid">
    <div class="row-fluid">
        
        
        {% if achievement %}
            {% if user.is_authenticated %}
                {% if not fulfilment %}
                <div class="span12">
                <center>
                
                <div class="page-header">
                    <h2>{{achievement.name}}</h2>
                </div>
            
                {% if password_form %}
                
                        <div class="well">
                        
                            <h4>Achievement je chránený heslom.</h4>
                        
                            {% if password_correct == 1 %}
                                <table class='table table-stripped' style="margin-bottom:0px;width:450px;">
                                <tr>
                                    <td colspan="3" style="border-top: none;">
                                        <div class="alert alert-success" style="margin-bottom:0px;">
                                            <strong>Úspech!</strong> Heslo prijaté.
                                        </div>
                                    </td>
                                    
                                <tr>
                                </table>
                                
                                <a href="{% url show_one_achievement achievement_id=achievement.uuid %}" class="btn btn-info" value="Odoslať">Pokračovať</a>
                            {% else %}
                        
                            <form action="" method="post" style="margin-bottom:0px;">{% csrf_token %}
                                <table class='table table-stripped' style="margin-bottom:0px;width:400px;">
                                        <tr>
                                            <td style="border-top: none;"><div class="lead pull-right" style="margin-bottom:0px;">Heslo:</div></td>
                                            <td style="border-top: none;">{{ password_form.as_p }}</td>
                                            <td style="border-top: none;"><input class="btn btn-info" type="submit" value="Odoslať" /></td>
                                        </tr>
                                        {% if password_correct == 2 %}
                                            <tr>
                                                <td colspan="3" style="border-top: none;">
                                                    <div class="alert alert-error" style="margin-bottom:0px;">
                                                        <strong>Chyba!</strong> Nesprávne heslo.
                                                    </div>
                                                </td>
                                            </tr>
                                        {% endif %}
                                </table>
                            </form>
                            
                            {% endif %}
                        
                        
                    </div>
                    
                    </center>
                    </div>

                {% endif %}
                
                {% else %}
                    <div class="alert">
                        <strong>Chyba!</strong> Achievement už bol splnený.
                    </div>
                {% endif %}
            
            {% else %}
                <div class="alert">
                    <strong>Chyba!</strong> Nie ste prihlásení.
                </div>
                <center>
                    <a href="{% url accounts_login %}">
                        <button class="btn btn-primary btn-large btn-info">Prihlásiť sa</button>
                    </a>
                </center>
            {% endif %}
        
        {% else %}
            <div class="alert alert-error">
                <strong>Chyba!</strong> Achievement nenájdený.
            </div>
        {% endif %}
        
        
    </div>
</div>



{% endblock %}

